package com.ruoyi.web.controller.system;

import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.pojo.GetTaskListReq;
import com.ruoyi.system.service.ISysUserService;
import com.ruoyi.system.service.SysBoatPolluteService;
import com.ruoyi.system.service.SysTaskService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = "可视化模块")
@RestController
@RequestMapping("/system/statistics")
public class StatisticsController {

    @Autowired
    private ISysUserService userService;

    @Autowired
    private SysTaskService sysTaskService;

    @Autowired
    private SysBoatPolluteService sysBoatPolluteServices;

    @ApiOperation("获取在线人数")
    @PostMapping("/getOnlinePerson")
    public AjaxResult getOnlinePerson() {
       return userService.getOnlinePerson();
    }

    @ApiOperation("获取任务统计")
    @PostMapping("/getTaskList")
    public AjaxResult getTaskList(@RequestBody GetTaskListReq param) {
        return sysTaskService.getTaskList(param);
    }

    @ApiOperation("获取污染点")
    @PostMapping("/getPollute")
    public AjaxResult getPollute() {
        return sysBoatPolluteServices.getPollute();
    }

}
